Skip to content

Commit

Permalink
IntelliJ code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirBlobman committed Nov 11, 2021
1 parent 413f5a0 commit fc9a7a0
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 90 deletions.
64 changes: 25 additions & 39 deletions CODE_OF_CONDUCT.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:
Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
Expand All @@ -22,53 +19,42 @@ include:

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
project or its community. Examples of representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed representative at an online or offline
event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
[email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CombatLogX Contribution Guide

1) Try to keep the code style the same, do not use Eclipse/IntelliJ auto-formatters.
2) If you are going to be a adding a feature, you might as well create an expansion instead. Expansions have access to the Bukkit API as well as the CombatLogX API.
2) If you are going to be a adding a feature, you might as well create an expansion instead. Expansions have access to
the Bukkit API as well as the CombatLogX API.
3) If you make a lot of changes, please create a detailed summary.
4) Follow the GitHub rules, project license, and all guidelines.
5) Good Luck and have fun!
29 changes: 21 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,55 +1,68 @@
# CombatLogX

[![Code Size](https://img.shields.io/github/languages/code-size/SirBlobman/CombatLogX)](https://github.com/SirBlobman/CombatLogX/)
[![Build Status](https://jenkins.sirblobman.xyz/job/SirBlobman/job/CombatLogX/badge/icon)](https://jenkins.sirblobman.xyz/job/SirBlobman/job/CombatLogX/)
[![Crowdin Localization](https://badges.crowdin.net/combatlogx-spigot-plugin/localized.svg)](https://crowdin.com/project/combatlogx-spigot-plugin)

# Description

CombatLogX is a plugin made for the Spigot server software.
It has many combat-related features to add to your server.
One of the main features of this plugin are the Expansions, which are like modules that allow you to add different things and change how the plugin works.
One of the main features of this plugin are the Expansions, which are like modules that allow you to add different
things and change how the plugin works.

# Dependencies

- [Spigot 1.8.8 - 1.17.1](https://spigotmc.org/)
- [SirBlobmanCore 2.3.1 or higher](https://jenkins.sirblobman.xyz/job/SirBlobman/job/SirBlobmanAPI/)

## Main Features

- Custom expansions that change how the plugin works
- Tag players when they attack other players
- Punish players that log out during combat

## Installation Guide

1. Download the CombatLogX.zip file from Jenkins or SpigotMC
2. Stop your server. (Click the stop button on the panel or type `stop` into the console if your server doesn't use a panel.)
2. Stop your server. (Click the stop button on the panel or type `stop` into the console if your server doesn't use a
panel.)
3. Upload the contents of CombatLogX.zip to your server.
4. Delete the CombatLogX.zip file.
5. If the files were uploaded and extracted correctly, your server should have the following files:
- File: `/plugins/CombatLogX.jar`
- File `/plugins/SirBlobmanCore.jar`
- Folder: `/plugins/CombatLogX/`
- Folder: `/plugins/CombatLogX/expansions/`
- Multiple Files: `/plugins/CombatLogX/expansions/*.jar`
- File: `/plugins/CombatLogX.jar`
- File `/plugins/SirBlobmanCore.jar`
- Folder: `/plugins/CombatLogX/`
- Folder: `/plugins/CombatLogX/expansions/`
- Multiple Files: `/plugins/CombatLogX/expansions/*.jar`
6. Start your server. (Click the start button on the panel or execute the script if your server doesn't use a panel.)
7. Edit the configuration files for the main plugin, languages, and expansions.
8. Type the command `/clx reload` to reload the configuration files.

## Localization

A translation project for CombatLogX V11 is in progress. If you wish to help out, please visit the Crowdin page below:
https://crowdin.com/project/combatlogx-spigot-plugin

### Localization Credits

https://crowdin.com/project/combatlogx-spigot-plugin/reports/top-members

## Expansions

If you want to find out more about the expansions, please visit this page:
<https://www.spigotmc.org/wiki/combatlogx/>

You can also open the README files in each expansion folder.

## Developer API
If you are looking for the source for the current version on Spigot (10.3.8.3), please check the "old/10.0.0.0" branch.

If you are looking for the source for the current version on Spigot (10.3.8.3), please check the "old/10.0.0.0"
branch.
If you want to create expansions or learn how to use the CombatLogX API for V11/Beta, please visit this page:
[API README](api/README.MD)

## Support

Support is provided by creating a new issue, or by chatting with the Support Team on my discord.
**Discord Link:** <https://discord.gg/XMq2agT>
8 changes: 8 additions & 0 deletions api/README.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# CombatLogX API

This is the API module for CombatLogX.
You can use it to create new expansions or to check stuff with your own plugin.

## Maven Repository

A lot of developers use maven to build projects more easily.

**Repository: SirBlobman Public**

```xml
<repositories>
<!-- SirBlobman Public Repository -->
Expand All @@ -17,6 +20,7 @@ A lot of developers use maven to build projects more easily.
```

**Dependency: CombatLogX API**

```xml
<dependencies>
<!-- CombatLogX API -->
Expand All @@ -30,19 +34,23 @@ A lot of developers use maven to build projects more easily.
```

## Events

A list of events and their uses can be found in the `com.github.sirblobman.combatlogx.api.event` package.
You can see more information about them below:

- **PlayerPreTagEvent:** Triggered before a player gets tagged. (cancellable)
- **PlayerTagEvent:** Triggered when a player gets tagged into combat (not cancellable).
- **PlayerReTagEvent:** Triggered when a player already has a timer, but they are tagged again. (cancellable)
- **PlayerUntagEvent:** Triggered when a player gets out of combat.
- **PlayerPunishEvent:** Triggered when a player is going to be punished for logging out (cancellable).

## Other API Uses

CombatLogX has many uses, but some common examples are provided below.
Good luck with your coding!

**Example 01: Check if a player is in combat.**

```java
public boolean isInCombat(Player player) {
// You need to ensure that CombatLogX is enabled before using it for anything.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public abstract class Expansion implements IResourceHolder {
private ExpansionLogger logger;
private ExpansionDescription description;
private ConfigurationManager configurationManager;

public Expansion(ICombatLogX plugin) {
this.plugin = Validate.notNull(plugin, "plugin must not be null!");
this.listenerList = new ArrayList<>();
Expand Down
3 changes: 3 additions & 0 deletions expansion/action-bar/README.MD
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# CombatLogX Expansion: Action Bar

The action bar expansion shows an action bar to every player that is in combat.

## Features

- Customizable action bar message and progress bar.
- Progress bar changes as timer goes down.

## Commands

- **/combatlogx toggle:**
- **/combatlogx toggle actionbar:** Enable or disable your action bar display.
5 changes: 4 additions & 1 deletion expansion/boss-bar/README.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# CombatLogX Expansion: Boss Bar

The boss bar expansion shows a boss bar to every player that is in combat.

## Features

- Customizable bar color and style.
- Customizable boss bar message.
- Boss Bar health changes as timer goes down.

## Commands

- **/combatlogx toggle:**
- **/combatlogx toggle bossbar:** Enable or disable your boss bar display.
- **/combatlogx toggle bossbar:** Enable or disable your boss bar display.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void onInteract(PlayerInteractEvent e) {
if(action != Action.RIGHT_CLICK_BLOCK && action != Action.LEFT_CLICK_BLOCK) {
return;
}

Block block = e.getClickedBlock();
if(block == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ public static StoredInventory createFrom(CitizensExpansion expansion, Configurat

return storedInventory;
}

@SuppressWarnings("deprecation")
private static void setHandLegacy(StoredInventory stored, PlayerInventory playerInventory) {
ItemStack item = playerInventory.getItemInHand();
stored.setMainHand(item);
stored.setOffHand(null);
}

private static void setHandModern(StoredInventory stored, PlayerInventory playerInventory) {
stored.setMainHand(playerInventory.getItemInMainHand());
stored.setOffHand(playerInventory.getItemInOffHand());
}

@Nullable
private static ItemStack loadItemStack(CitizensExpansion expansion, ConfigurationSection section, String path) {
Validate.notNull(section, "section must not be null!");
Expand Down
5 changes: 4 additions & 1 deletion expansion/compatibility/MVdWPlaceholderAPI/README.MD
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# CombatLogX Expansion: MVdWPlaceholderAPI Compatibility

The MVdWPlaceholderAPI Compatibility expansion for CombatLogX adds placeholders to plugins that use MVdWPlaceholderAPI.

## Valid Placeholders

| Placeholder | Description |
| ----------- | ----------- |
| `{combatlogx_time_left}` | This is the amount of time (in seconds) that a player has left in combat. The zero value can be customized in the language files. |
| `{combatlogx_in_combat}` | This displays different configurable values when a player is in combat and when they are not. |
| `{combatlogx_status}` | This displays different configurable values when a player is in combat and when they are not. *Different than in_combat* |
| `{combatlogx_status}` | This displays different configurable values when a player is in combat and when they are not. *
Different than in_combat* |
| `{combatlogx_punishment_count}` | This displays the amount of times a player has been punished for logging out during combat. |
| `{combatlogx_enemy_name}` | This shows the name of the current enemy entity (or unknown). |
| `{combatlogx_enemy_diplay_name}` | This shows the display name of the current enemy entity (or unknown). |
Expand Down
5 changes: 4 additions & 1 deletion expansion/compatibility/PlaceholderAPI/README.MD
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# CombatLogX Expansion: PlaceholderAPI Compatibility

The PlaceholderAPI Compatibility expansion for CombatLogX adds placeholders to plugins that use PlaceholderAPI.

## Valid Placeholders

| Placeholder | Description |
| ----------- | ----------- |
| `%combatlogx_time_left%` | This is the amount of time (in seconds) that a player has left in combat. The zero value can be customized in the language files. |
| `%combatlogx_in_combat%` | This displays different configurable values when a player is in combat and when they are not. |
| `%combatlogx_status%` | This displays different configurable values when a player is in combat and when they are not. *Different than in_combat* |
| `%combatlogx_status%` | This displays different configurable values when a player is in combat and when they are not. *
Different than in_combat* |
| `%combatlogx_punishment_count%` | This displays the amount of times a player has been punished for logging out during combat. |
| `%combatlogx_enemy_name%` | This shows the name of the current enemy entity (or unknown). |
| `{combatlogx_enemy_diplay_name%` | This shows the display name of the current enemy entity (or unknown). |
Expand Down
6 changes: 5 additions & 1 deletion expansion/compatibility/README.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CombatLogX Compatibility Expansions

Compatibility expansions add features to CombatLogX based on the plugin that they add compatibility for.

## Compatibility Table

<table>
<thead>
<tr>
Expand Down Expand Up @@ -77,13 +79,15 @@ Compatibility expansions add features to CombatLogX based on the plugin that the
</table>

## Placeholder List

Surround with `%%` for PlaceholderAPI or `{}` for MVdWPlaceholderAPI.

| Placeholder | Description |
| ----------- | ----------- |
| `combatlogx_time_left` | This is the amount of time (in seconds) that a player has left in combat. The zero value can be customized in the language files. |
| `combatlogx_in_combat` | This displays different configurable values when a player is in combat and when they are not. |
| `combatlogx_status` | This displays different configurable values when a player is in combat and when they are not. *Different than in_combat* |
| `combatlogx_status` | This displays different configurable values when a player is in combat and when they are not. *
Different than in_combat* |
| `combatlogx_enemy_name` | This shows the name of the current enemy entity (or unknown). |
| `combatlogx_enemy_health` | This displays the health decimal of the current enemy entity (or unknown) |
| `combatlogx_enemy_health_rounded` | This shows the health integer of the current enemy entity (or unknown) |
Expand Down
2 changes: 2 additions & 0 deletions expansion/damage-tagger/README.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CombatLogX Expansion: Damage Tagger

The damage tagger expansion allows you to tag players for non-combat damage types.

## Available Damage Types:

| Damage Type | Description |
| ----------- | ----------- |
| **CONTACT** | Touching a cactus or a berry bush. |
Expand Down
6 changes: 4 additions & 2 deletions expansion/death-effects/README.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# CombatLogX Expansion: Death Effects
The death effects expansion creates different effects when players die.
You can configure these effects to trigger for combat-log deaths or for all deaths.

The death effects expansion creates different effects when players die. You can configure these effects to trigger for
combat-log deaths or for all deaths.

## Available Death Effects:

| Effect | Description |
| ----------- | ----------- |
| **LIGHTNING** | Spawn a lightning bolt at a player's location. Configurable silence and effect-only. |
Expand Down
Loading

0 comments on commit fc9a7a0

Please sign in to comment.