Skip to content

Commit 799148c

Browse files
committed
Documentation and code cleanup
1 parent e14000b commit 799148c

File tree

8 files changed

+161
-84
lines changed

8 files changed

+161
-84
lines changed

README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
[![Build](https://github.com/promcteam/proskillapi/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/promcteam/proskillapi/actions/workflows/maven.yml/badge.svg)
22

3-
# PROSKILLAPI
3+
# ProSkillAPI
44
Our fork is based on the original skillapi and the forked skillapi by Sentropic.
55
* Includes all premium features from the original premium version of Skillapi found on spigot.
66

77
## New dynamic editor
8-
You'll need to use this editor in order for your classes and skills to be compatible with PROSKILLAPI.
8+
You'll need to use this editor in order for your classes and skills to be compatible with ProSkillAPI.
99
* Online Editor: https://promcteam.github.io/proskillapi/
1010

1111
## Downloads
12-
You can download PROSKILLAPI form our marketplace
12+
You can download ProSkillAPI form our marketplace
1313
* https://promcteam.com/resources/
1414

1515
## PROMCTEAM:
1616
* Discord | https://discord.gg/RhTyRReKyP
17+
# proskillapi
18+
19+
If you wish to use ProSkillAPI as a dependency in your projects, include the following in your `pom.xml`
20+
21+
```xml
22+
<repository>
23+
<id>github</id>
24+
<url>https://maven.pkg.github.com/promcteam/promccore</url>
25+
</repository>
26+
...
27+
<dependency>
28+
<groupId>mc.promcteam</groupId>
29+
<artifactId>proskillapi</artifactId>
30+
<version>1.1.7.13-ALPHA</version>
31+
</dependency>
32+
```
33+
34+
Additionally, you'll need to make sure that you have properly configured [Authentication with GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages).

doc/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[![Build](https://github.com/promcteam/proskillapi/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/promcteam/proskillapi/actions/workflows/maven.yml/badge.svg)
2+
3+
# ${project.name}
4+
Our fork is based on the original skillapi and the forked skillapi by Sentropic.
5+
* Includes all premium features from the original premium version of Skillapi found on spigot.
6+
7+
## New dynamic editor
8+
You'll need to use this editor in order for your classes and skills to be compatible with ${project.name}.
9+
* Online Editor: https://promcteam.github.io/proskillapi/
10+
11+
## Downloads
12+
You can download ${project.name} form our marketplace
13+
* https://promcteam.com/resources/
14+
15+
## PROMCTEAM:
16+
* Discord | https://discord.gg/RhTyRReKyP
17+
18+
# Development
19+
20+
If you wish to use ${project.name} as a dependency in your projects, include the following in your `pom.xml`
21+
22+
```xml
23+
<repository>
24+
<id>github</id>
25+
<url>https://maven.pkg.github.com/promcteam/promccore</url>
26+
</repository>
27+
...
28+
<dependency>
29+
<groupId>${project.groupId}</groupId>
30+
<artifactId>${project.artifactId}</artifactId>
31+
<version>${project.version}</version>
32+
</dependency>
33+
```
34+
35+
Additionally, you'll need to make sure that you have properly configured [Authentication with GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages).

pom.xml

+39-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.sucy.skill</groupId>
8-
<artifactId>ProSkillAPI</artifactId>
9-
<version>1.1.7.12-ALPHA</version>
7+
<groupId>mc.promcteam</groupId>
8+
<artifactId>proskillapi</artifactId>
9+
<version>1.1.7.13-ALPHA</version>
1010
<packaging>jar</packaging>
1111

1212
<name>ProSkillAPI</name>
@@ -263,6 +263,34 @@
263263
</replacements>
264264
</configuration>
265265
</plugin>
266+
267+
<plugin>
268+
<groupId>org.apache.maven.plugins</groupId>
269+
<artifactId>maven-resources-plugin</artifactId>
270+
<version>3.1.0</version>
271+
<executions>
272+
<execution>
273+
<id>readme</id>
274+
<phase>process-resources</phase>
275+
<goals>
276+
<goal>copy-resources</goal>
277+
</goals>
278+
<configuration>
279+
<outputDirectory>${project.basedir}</outputDirectory>
280+
<resources>
281+
<resource>
282+
<directory>doc</directory>
283+
<includes>
284+
<include>README.md</include>
285+
</includes>
286+
<filtering>true</filtering>
287+
</resource>
288+
</resources>
289+
<!-- <encoding>UTF-8</encoding>-->
290+
</configuration>
291+
</execution>
292+
</executions>
293+
</plugin>
266294
</plugins>
267295
<resources>
268296
<resource>
@@ -271,4 +299,12 @@
271299
</resource>
272300
</resources>
273301
</build>
302+
303+
<distributionManagement>
304+
<repository>
305+
<id>promcteam</id>
306+
<name>ProMCTeam</name>
307+
<url>https://maven.pkg.github.com/promcteam/promccore</url>
308+
</repository>
309+
</distributionManagement>
274310
</project>
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/**
22
* SkillAPI
33
* com.sucy.skill.api.event.SkillDamageEvent
4-
*
4+
* <p>
55
* The MIT License (MIT)
6-
*
6+
* <p>
77
* Copyright (c) 2014 Steven Sucy
8-
*
8+
* <p>
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software") to deal
1111
* in the Software without restriction, including without limitation the rights
1212
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1313
* copies of the Software, and to permit persons to whom the Software is
1414
* furnished to do so, subject to the following conditions:
15-
*
15+
* <p>
1616
* The above copyright notice and this permission notice shall be included in
1717
* all copies or substantial portions of the Software.
18-
*
18+
* <p>
1919
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2020
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -27,6 +27,8 @@
2727
package com.sucy.skill.api.event;
2828

2929
import com.sucy.skill.api.skills.Skill;
30+
import lombok.Getter;
31+
import lombok.Setter;
3032
import org.bukkit.entity.LivingEntity;
3133
import org.bukkit.event.Cancellable;
3234
import org.bukkit.event.Event;
@@ -36,83 +38,65 @@
3638
* An event for when an entity is damaged by
3739
* another entity with the use of a skill.
3840
*/
39-
public class SkillDamageEvent extends Event implements Cancellable
40-
{
41-
private static final HandlerList handlers = new HandlerList();
42-
private LivingEntity damager;
43-
private LivingEntity target;
44-
private String classification;
45-
private Skill skill;
46-
private double damage;
47-
private boolean cancelled;
48-
41+
public class SkillDamageEvent extends Event implements Cancellable {
42+
private static final HandlerList handlers = new HandlerList();
4943
/**
50-
* Initializes a new event
44+
* Retrieves the entity that dealt the damage
5145
*
52-
* @param skill skill used to deal damage
53-
* @param damager entity dealing the damage
54-
* @param target entity receiving the damage
55-
* @param damage the amount of damage dealt
56-
* @param classification
46+
* @return entity that dealt the damage
5747
*/
58-
public SkillDamageEvent(Skill skill, LivingEntity damager, LivingEntity target, double damage, String classification)
59-
{
60-
this.skill = skill;
61-
this.damager = damager;
62-
this.target = target;
63-
this.damage = damage;
64-
this.classification = classification;
65-
this.cancelled = false;
66-
}
67-
48+
@Getter private final LivingEntity damager;
6849
/**
69-
* @return skill used to deal the damage
50+
* Retrieves the entity that received the damage
51+
*
52+
* @return entity that received the damage
7053
*/
71-
public Skill getSkill() {
72-
return skill;
73-
}
74-
54+
@Getter private final LivingEntity target;
55+
@Getter private final String classification;
7556
/**
76-
* Retrieves the entity that dealt the damage
77-
*
78-
* @return entity that dealt the damage
57+
* @return skill used to deal the damage
7958
*/
80-
public LivingEntity getDamager()
81-
{
82-
return damager;
83-
}
59+
@Getter private final Skill skill;
60+
private double damage;
61+
@Getter
62+
@Setter
63+
private boolean knockback;
64+
private boolean cancelled = false;
8465

8566
/**
86-
* Retrieves the entity that received the damage
67+
* Initializes a new event
8768
*
88-
* @return entity that received the damage
69+
* @param skill skill used to deal damage
70+
* @param damager entity dealing the damage
71+
* @param target entity receiving the damage
72+
* @param damage the amount of damage dealt
73+
* @param classification
8974
*/
90-
public LivingEntity getTarget()
91-
{
92-
return target;
75+
public SkillDamageEvent(Skill skill, LivingEntity damager, LivingEntity target, double damage,
76+
String classification, boolean knockback) {
77+
this.skill = skill;
78+
this.damager = damager;
79+
this.target = target;
80+
this.damage = damage;
81+
this.classification = classification;
82+
this.knockback = knockback;
9383
}
9484

9585
/**
9686
* Retrieves the amount of damage dealt
9787
*
9888
* @return amount of damage dealt
9989
*/
100-
public double getDamage()
101-
{
90+
public double getDamage() {
10291
return damage;
10392
}
10493

105-
public String getClassification() {
106-
return classification;
107-
}
108-
10994
/**
11095
* Sets the amount of damage dealt
11196
*
11297
* @param amount amount of damage dealt
11398
*/
114-
public void setDamage(double amount)
115-
{
99+
public void setDamage(double amount) {
116100
damage = amount;
117101
}
118102

@@ -122,8 +106,7 @@ public void setDamage(double amount)
122106
* @return true if cancelled, false otherwise
123107
*/
124108
@Override
125-
public boolean isCancelled()
126-
{
109+
public boolean isCancelled() {
127110
return cancelled;
128111
}
129112

@@ -133,8 +116,7 @@ public boolean isCancelled()
133116
* @param cancelled the cancelled state of the event
134117
*/
135118
@Override
136-
public void setCancelled(boolean cancelled)
137-
{
119+
public void setCancelled(boolean cancelled) {
138120
this.cancelled = cancelled;
139121
}
140122

@@ -144,8 +126,7 @@ public void setCancelled(boolean cancelled)
144126
* @return list of event handlers
145127
*/
146128
@Override
147-
public HandlerList getHandlers()
148-
{
129+
public HandlerList getHandlers() {
149130
return handlers;
150131
}
151132

@@ -154,8 +135,7 @@ public HandlerList getHandlers()
154135
*
155136
* @return list of event handlers
156137
*/
157-
public static HandlerList getHandlerList()
158-
{
138+
public static HandlerList getHandlerList() {
159139
return handlers;
160140
}
161141
}

src/main/java/com/sucy/skill/api/skills/Skill.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ public void damage(LivingEntity target, double damage, LivingEntity source, Stri
721721
// EntityDamageByEntityEvent unless we use knockback
722722
if (!SkillAPI.getSettings().canAttack(source, target)) return;
723723

724-
SkillDamageEvent event = new SkillDamageEvent(this, source, target, damage, classification);
724+
SkillDamageEvent event = new SkillDamageEvent(this, source, target, damage, classification, knockback);
725725
Bukkit.getPluginManager().callEvent(event);
726726
if (!event.isCancelled()) {
727727
if (source instanceof Player) {
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/**
22
* SkillAPI
33
* com.sucy.skill.hook.NoCheatHook
4-
*
4+
* <p>
55
* The MIT License (MIT)
6-
*
6+
* <p>
77
* Copyright (c) 2014 Steven Sucy
8-
*
8+
* <p>
99
* Permission is hereby granted, free of charge, to any person obtaining a copy
1010
* of this software and associated documentation files (the "Software"), to deal
1111
* in the Software without restriction, including without limitation the rights
1212
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1313
* copies of the Software, and to permit persons to whom the Software is
1414
* furnished to do so, subject to the following conditions:
15-
*
15+
* <p>
1616
* The above copyright notice and this permission notice shall be included in
1717
* all copies or substantial portions of the Software.
18-
*
18+
* <p>
1919
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2020
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -32,15 +32,13 @@
3232
/**
3333
* Handles plugin calls to NoCheatPlus to get around it blocking skill effects
3434
*/
35-
public class NoCheatHook
36-
{
35+
public class NoCheatHook {
3736
/**
3837
* Exempts the player from NCP functionality
3938
*
4039
* @param player player to exempt
4140
*/
42-
public static void exempt(Player player)
43-
{
41+
public static void exempt(Player player) {
4442
NCPExemptionManager.exemptPermanently(player);
4543
}
4644

@@ -49,8 +47,7 @@ public static void exempt(Player player)
4947
*
5048
* @param player player to unexempt
5149
*/
52-
public static void unexempt(Player player)
53-
{
50+
public static void unexempt(Player player) {
5451
NCPExemptionManager.unexempt(player);
5552
}
5653
}

0 commit comments

Comments
 (0)