Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic"
}
175 changes: 173 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,176 @@
# PlayerProfiles
If you're looking to get a support for this plugin, please add **mdaffa** on discord!

# License
A modern Minecraft plugin for viewing player profiles with detailed statistics, inventory, and more. This fork provides full support for **Paper 1.21.11+** servers.

## Features

- **Player Profiles** - View detailed player information, inventory, armor, ender chest, and statistics
- **Custom GUIs** - Create and manage custom GUI profiles with flexible configuration
- **WorldGuard Integration** - Region-based profile access control (disabled regions)
- **Combat Integration** - CombatLogX and DeluxeCombat support (disable profiles in combat)
- **PlaceholderAPI Support** - Full placeholder support for dynamic content
- **Profile Locking** - Players can lock/unlock their profiles
- **Cooldown System** - Configurable cooldowns for profile viewing
- **Distance Checks** - Auto-close profiles when players move too far apart
- **Multi-world Support** - Disable profiles in specific worlds
- **Auto-refresh** - Automatic placeholder updates in GUI items
- **Metrics** - bStats integration for plugin statistics

## Requirements

- **Paper 1.21.11+** (or compatible forks)
- **Java 21**
- **WorldGuard 7.x** (for region features)
- **WorldEdit 7.x** (required by WorldGuard)
- Optional: **PlaceholderAPI**, **CombatLogX**, **DeluxeCombat**

## Installation

1. Download the latest `PlayerProfiles-8.0.5.jar` from releases
2. Place in your server's `plugins/` folder
3. Restart the server
4. Configure `plugins/PlayerProfiles/config.yml` to your needs
5. Run `/playerprofiles reload` to apply changes

## Configuration

Main configuration files in `plugins/PlayerProfiles/`:

| File | Description |
|------|-------------|
| `config.yml` | Main settings (cooldowns, combat, worlds, regions, sounds) |
| `gui.yml` | Default profile GUI layout and items |
| `gui-creator.yml` | Custom GUI creator settings |
| `data.yml` | Player profile data storage |
| `custom-gui/punish-gui.yml` | Example custom GUI |

### Key Config Options

```yaml
options:
disableNPC: true # Disable NPC profile viewing
disableInCombat:
enabled: true # Block profiles in combat
message: "{prefix} &cYou are not allowed to open profile while in combat!"
shiftClick: true # Shift+right-click to open profile

autoRefresh:
enabled: true # Auto-update placeholders
refreshEvery: 20 # Update interval (ticks)

cooldown:
enabled: true
duration: 3 # Seconds
message: "{prefix} &cPlease wait for another {time} second(s)!"

disabledWorlds:
message: "{prefix} &cYou are not allowed to open profile in this world!"
worlds:
- 'pvpWorld'

disabledRegions:
playerInDisabledRegionMessage: "{prefix} &cYou are not allowed to open profile in this region!"
targetInDisabledRegionMessage: "{prefix} &cThe target is in disabled region area!"
regions:
- 'disabledRegions'
- 'pvp'

distanceCheck:
enabled: true
distance: 30 # Blocks
tooFarMessage: "{prefix} &e{player} &cis too far from you!"
```

## Commands

| Command | Aliases | Permission | Description |
|---------|---------|------------|-------------|
| `/playerprofiles` | `/pp`, `/playerprofile`, `/playerp` | `playerprofiles.admin` | Main command |
| `/playerprofiles reload` | | `playerprofiles.admin` | Reload configuration |
| `/playerprofiles opengui <player> <target> <gui>` | | `playerprofiles.admin` | Open custom GUI for player |
| `/playerprofiles listgui` | | `playerprofiles.admin` | List available custom GUIs |
| `/profile [player]` | `/p`, `/viewprofile` | `playerprofiles.profile` | View profile |
| `/lockprofile [player]` | `/lock`, `/profilelock` | `playerprofiles.lock` | Lock profile |
| `/unlockprofile [player]` | `/unlock`, `/profileunlock` | `playerprofiles.unlock` | Unlock profile |
| `/toggleprofile` | | `playerprofiles.toggle` | Toggle profile viewing |

## Permissions

```
playerprofiles.* # All permissions
playerprofiles.admin # Admin commands (reload, opengui, listgui)
playerprofiles.profile # View profiles (/profile)
playerprofiles.profile.others # View other players' profiles
playerprofiles.lock # Lock own profile
playerprofiles.lock.others # Lock others' profiles
playerprofiles.unlock # Unlock own profile
playerprofiles.unlock.others # Unlock others' profiles
playerprofiles.toggle # Toggle profile viewing
playerprofiles.bypass.cooldown # Bypass profile cooldown
playerprofiles.bypass.distance # Bypass distance check
playerprofiles.bypass.combat # Bypass combat restriction
playerprofiles.bypass.disabledworld # Bypass disabled worlds
playerprofiles.bypass.disabledregion # Bypass disabled regions
```

## Custom GUI Creation

Create custom GUIs in `gui-creator.yml` or use the in-game creator:

1. Run `/playerprofiles opengui <player> <target> <gui-name>` to open a custom GUI
2. Use `/playerprofiles listgui` to see available GUIs
3. Configure custom GUIs in `custom-gui/` folder

## Placeholders

With PlaceholderAPI installed, these placeholders are available:

- `%playerprofiles_<stat>%` - Player statistics
- `%playerprofiles_kills%` - Player kills (if supported)
- `%playerprofiles_deaths%` - Player deaths (if supported)
- Any PAPI placeholder can be used in GUI items and messages

## Building from Source

```bash
# Requires Java 21 and Maven 3.8+
git clone https://github.com/evnrca/PlayerProfiles26.git
cd PlayerProfiles26
mvn clean package -DskipTests
# Output: target/PlayerProfiles-8.0.5.jar
```

## Module Structure

```
PlayerProfiles/
├── api/ # Core API interfaces
├── core/ # Main plugin logic
├── worldguard-wrapper/ # WorldGuard version abstraction
├── worldguard7/ # WorldGuard 7.x implementation
└── dist/ # Final shaded JAR assembly
```

## Changes in This Fork (v8.0.5)

- **Java 21** baseline
- **Paper 1.21.11** support
- **WorldGuard 7.0.10** / **WorldEdit 7.3.12**
- Removed legacy WorldGuard 6.x module
- Simplified WorldGuard wrapper (single implementation)
- Fixed DependencyManager brace issues
- Updated plugin.yml api-version to 1.21
- Modernized RegionFinder for WG7 API

## License

You can do whatever you want with the source code, just don't redistribute it.

## Support

For support, join the Discord and contact **mdaffa**.

---

**Original Author**: aglerr, Starfruit2210
**Fork Maintainer**: evnrca
6 changes: 2 additions & 4 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<parent>
<groupId>com.muhammaddaffa</groupId>
<artifactId>PlayerProfiles</artifactId>
<version>8.0.4</version>
<version>8.0.5</version>
</parent>

<artifactId>api</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -30,7 +28,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
23 changes: 4 additions & 19 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<parent>
<groupId>com.muhammaddaffa</groupId>
<artifactId>PlayerProfiles</artifactId>
<version>8.0.4</version>
<version>8.0.5</version>
</parent>

<artifactId>core</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -71,7 +69,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.5-R0.1-SNAPSHOT</version>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -84,22 +82,9 @@
<dependency>
<groupId>com.github.mdaffa48</groupId>
<artifactId>MDLib</artifactId>
<version>2.3.3</version>
</dependency>
<!-- BlueSlimeCore -->
<dependency>
<groupId>com.github.sirblobman.api</groupId>
<artifactId>core</artifactId>
<version>2.9-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- CombatLogX API -->
<dependency>
<groupId>com.github.sirblobman.combatlogx</groupId>
<artifactId>api</artifactId>
<version>11.4-SNAPSHOT</version>
<scope>provided</scope>
<version>2.3.8</version>
</dependency>
<!-- DeluxeCombat API -->
<dependency>
<groupId>com.github.timderspieler</groupId>
<artifactId>DeluxeCombat-API</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
package com.muhammaddaffa.playerprofiles.hooks.combatlogx;

import com.github.sirblobman.combatlogx.api.ICombatLogX;
import com.github.sirblobman.combatlogx.api.manager.ICombatManager;
import com.muhammaddaffa.mdlib.utils.Logger;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import java.lang.reflect.Method;

public class HCombatLogX {

public static boolean isInCombat(Player player){
ICombatLogX plugin = (ICombatLogX) Bukkit.getPluginManager().getPlugin("CombatLogX");
ICombatManager combatManager = plugin.getCombatManager();
return combatManager.isInCombat(player);
private static Method isInCombatMethod;
private static boolean initialized = false;

private static void initialize() {
if (initialized) return;
initialized = true;

Plugin plugin = Bukkit.getPluginManager().getPlugin("CombatLogX");
if (plugin == null) return;

try {
Class<?> combatLogXClass = Class.forName("com.github.sirblobman.combatlogx.api.ICombatLogX");
Class<?> combatManagerClass = Class.forName("com.github.sirblobman.combatlogx.api.manager.ICombatManager");

Method getCombatManagerMethod = combatLogXClass.getMethod("getCombatManager");
Object combatManager = getCombatManagerMethod.invoke(plugin);

isInCombatMethod = combatManagerClass.getMethod("isInCombat", Player.class);
} catch (Exception e) {
Logger.severe("Failed to initialize CombatLogX hook: " + e.getMessage());
}
}

public static boolean isInCombat(Player player) {
initialize();
if (isInCombatMethod == null) return false;

try {
Plugin plugin = Bukkit.getPluginManager().getPlugin("CombatLogX");
if (plugin == null) return false;

Class<?> combatLogXClass = Class.forName("com.github.sirblobman.combatlogx.api.ICombatLogX");
Method getCombatManagerMethod = combatLogXClass.getMethod("getCombatManager");
Object combatManager = getCombatManagerMethod.invoke(plugin);

return (boolean) isInCombatMethod.invoke(combatManager, player);
} catch (Exception e) {
return false;
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ public static void checkDependency(){
if(WORLD_GUARD){
Plugin plugin = pm.getPlugin("WorldGuard");

if(plugin.getDescription().getVersion().startsWith("6"))
if(plugin.getDescription().getVersion().startsWith("6")) {
Logger.info("&rFound WorldGuard! Using WorldGuard API version 6");
WORLD_GUARD_VERSION = 6;
}

if(plugin.getDescription().getVersion().startsWith("7"))
if(plugin.getDescription().getVersion().startsWith("7")) {
Logger.info("&rFound WorldGuard! Using WorldGuard API version 7");
WORLD_GUARD_VERSION = 7;
}
}

}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: PlayerProfiles
version: 8.0.3
version: 8.0.5
main: com.muhammaddaffa.playerprofiles.PlayerProfiles
author: aglerr, Starfruit2210
description: Plugin to show player profiles
api-version: 1.13
api-version: 1.21
softdepend: [CombatLogX, DeluxeCombat, PlaceholderAPI, WorldGuard, WorldEdit]

commands:
Expand Down
9 changes: 1 addition & 8 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<parent>
<groupId>com.muhammaddaffa</groupId>
<artifactId>PlayerProfiles</artifactId>
<version>8.0.4</version>
<version>8.0.5</version>
</parent>

<artifactId>dist</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -55,11 +53,6 @@
<artifactId>api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguard6</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguard7</artifactId>
Expand Down
Loading