mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-21 16:09:27 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f21749a45d | ||
|
|
eeb2ef960b | ||
|
|
6e4c4bc127 | ||
|
|
ca73a9e5b4 |
21
README.md
Normal file
21
README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# HMCCosmetics
|
||||||
|
----
|
||||||
|
|
||||||
|
<a href="https://img.shields.io/badge/License-gpl-v3"><img src="https://img.shields.io/badge/License-gpl-v3"></a>
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
- [Description](#description)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Contact Information](#contact-information)
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
HMCCosmetics is a free, open source cosmetics plugin which allows you to easily give players backpack and hat type cosmetics.
|
||||||
|
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
- Server running PaperMC (or a fork of PaperMC)
|
||||||
|
- ProtocolLib
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ dependencies {
|
|||||||
implementation 'dev.triumphteam:triumph-gui:3.0.3'
|
implementation 'dev.triumphteam:triumph-gui:3.0.3'
|
||||||
implementation 'me.mattstudios.utils:matt-framework:1.4.6'
|
implementation 'me.mattstudios.utils:matt-framework:1.4.6'
|
||||||
implementation 'org.spongepowered:configurate-yaml:4.1.2'
|
implementation 'org.spongepowered:configurate-yaml:4.1.2'
|
||||||
|
implementation 'org.bstats:bstats-bukkit:2.2.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
@@ -40,6 +41,7 @@ shadowJar {
|
|||||||
relocate 'net.kyori.adventure.text.minimessage', 'io.github.fisher2911.hmccosmetics.adventure.minimessage'
|
relocate 'net.kyori.adventure.text.minimessage', 'io.github.fisher2911.hmccosmetics.adventure.minimessage'
|
||||||
relocate 'net.kyori.adventure.platform', 'io.github.fisher2911.hmccosmetics.adventure.platform'
|
relocate 'net.kyori.adventure.platform', 'io.github.fisher2911.hmccosmetics.adventure.platform'
|
||||||
relocate 'org.spongepowered.configurate', 'io.github.fisher2911.hmccosmetics.configurate'
|
relocate 'org.spongepowered.configurate', 'io.github.fisher2911.hmccosmetics.configurate'
|
||||||
|
relocate 'org.bstats', 'io.github.fisher2911.hmccosmetics.bstats'
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import io.github.fisher2911.hmccosmetics.message.MessageHandler;
|
|||||||
import io.github.fisher2911.hmccosmetics.message.Messages;
|
import io.github.fisher2911.hmccosmetics.message.Messages;
|
||||||
import io.github.fisher2911.hmccosmetics.user.UserManager;
|
import io.github.fisher2911.hmccosmetics.user.UserManager;
|
||||||
import me.mattstudios.mf.base.CommandManager;
|
import me.mattstudios.mf.base.CommandManager;
|
||||||
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -30,6 +31,9 @@ public class HMCCosmetics extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
final int pluginId = 13873;
|
||||||
|
final Metrics metrics = new Metrics(this, pluginId);
|
||||||
|
|
||||||
protocolManager = ProtocolLibrary.getProtocolManager();
|
protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
this.messageHandler = new MessageHandler(this);
|
this.messageHandler = new MessageHandler(this);
|
||||||
this.userManager = new UserManager(this);
|
this.userManager = new UserManager(this);
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import io.github.fisher2911.hmccosmetics.gui.ArmorItem;
|
|||||||
import io.github.fisher2911.hmccosmetics.inventory.PlayerArmor;
|
import io.github.fisher2911.hmccosmetics.inventory.PlayerArmor;
|
||||||
import io.github.fisher2911.hmccosmetics.message.MessageHandler;
|
import io.github.fisher2911.hmccosmetics.message.MessageHandler;
|
||||||
import io.github.fisher2911.hmccosmetics.message.Messages;
|
import io.github.fisher2911.hmccosmetics.message.Messages;
|
||||||
|
import io.github.fisher2911.hmccosmetics.util.Keys;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.EntityEquipment;
|
import org.bukkit.inventory.EntityEquipment;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -161,6 +163,11 @@ public class User {
|
|||||||
armorStand -> {
|
armorStand -> {
|
||||||
armorStand.setVisible(false);
|
armorStand.setVisible(false);
|
||||||
armorStand.setMarker(true);
|
armorStand.setMarker(true);
|
||||||
|
armorStand.getPersistentDataContainer().set(
|
||||||
|
Keys.ARMOR_STAND_KEY,
|
||||||
|
PersistentDataType.BYTE,
|
||||||
|
(byte) 1
|
||||||
|
);
|
||||||
player.addPassenger(armorStand);
|
player.addPassenger(armorStand);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class Keys {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final NamespacedKey ITEM_KEY = new NamespacedKey(plugin, "cosmetic");
|
public static final NamespacedKey ITEM_KEY = new NamespacedKey(plugin, "cosmetic");
|
||||||
|
public static final NamespacedKey ARMOR_STAND_KEY = new NamespacedKey(plugin, "armor-stand");
|
||||||
|
|
||||||
public static void setKey(final ItemStack itemStack) {
|
public static void setKey(final ItemStack itemStack) {
|
||||||
final ItemMeta itemMeta = itemStack.getItemMeta();
|
final ItemMeta itemMeta = itemStack.getItemMeta();
|
||||||
|
|||||||
Reference in New Issue
Block a user