mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2026-01-06 15:51:50 +00:00
Compare commits
15 Commits
1_11_2_dev
...
1.11.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70c2b79b6c | ||
|
|
39d485ddfe | ||
|
|
548a6bf4ec | ||
|
|
fb15919f52 | ||
|
|
9a5923bb7d | ||
|
|
02239396f0 | ||
|
|
942d48adf8 | ||
|
|
99ae2b765a | ||
|
|
6b59ba88a5 | ||
|
|
4d7dff885a | ||
|
|
f4bc6f1bc3 | ||
|
|
938dfe677d | ||
|
|
1c30924410 | ||
|
|
bd731c8b6b | ||
|
|
41f4f830d1 |
@@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "io.github.fisher2911"
|
||||
version = "1.11.0-BETA-4"
|
||||
version = "1.11.2"
|
||||
description = "Intuitive, easy-to-use cosmetics plugin, designed for servers using resource packs.\n"
|
||||
|
||||
repositories {
|
||||
@@ -21,7 +21,13 @@ repositories {
|
||||
maven("https://mvnrepository.com/artifact/com.zaxxer/HikariCP")
|
||||
maven("https://repo.jeff-media.de/maven2/")
|
||||
maven("https://repo.citizensnpcs.co")
|
||||
maven("https://mvn.lumine.io/repository/maven-public")
|
||||
//maven("https://mvn.lumine.io/repository/maven-public")
|
||||
maven {
|
||||
url = uri("https://mvn.lumine.io/repository/maven-public")
|
||||
metadataSources {
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven("https://jitpack.io/")
|
||||
}
|
||||
|
||||
@@ -38,7 +44,7 @@ dependencies {
|
||||
compileOnly("com.github.oraxen:oraxen:-SNAPSHOT")
|
||||
compileOnly("com.github.LoneDev6:API-ItemsAdder:2.5.4")
|
||||
compileOnly("net.citizensnpcs:citizens-main:2.0.29-SNAPSHOT")
|
||||
compileOnly("com.ticxo.modelengine:api:R2.5.0:")
|
||||
compileOnly("com.ticxo.modelengine:api:R2.5.0")
|
||||
compileOnly("com.github.retrooper.packetevents:spigot:2.0-SNAPSHOT")
|
||||
implementation("net.kyori:adventure-api:4.10.0")
|
||||
implementation ("net.kyori:adventure-text-minimessage:4.10.0-SNAPSHOT")
|
||||
@@ -141,3 +147,22 @@ bukkit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val copyJar: String? by project
|
||||
val pluginPath = project.findProperty("hibiscusmc_plugin_path")
|
||||
|
||||
if(copyJar != "false" && pluginPath != null) {
|
||||
tasks {
|
||||
register<Copy>("copyJar") {
|
||||
from(findByName("reobfJar") ?: findByName("shadowJar") ?: findByName("jar"))
|
||||
into(pluginPath)
|
||||
doLast {
|
||||
println("Copied to plugin directory $pluginPath")
|
||||
}
|
||||
}
|
||||
|
||||
named<DefaultTask>("build") {
|
||||
dependsOn("copyJar")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ public class CosmeticManager {
|
||||
|
||||
public void load() {
|
||||
this.clearItems();
|
||||
this.backpackParticleCounts.clear();
|
||||
try {
|
||||
final File file = ITEMS_PATH.toFile();
|
||||
if (!file.exists()) {
|
||||
@@ -115,7 +116,7 @@ public class CosmeticManager {
|
||||
if (item instanceof ArmorItem armorItem) {
|
||||
armorItem.setAction(null);
|
||||
if (armorItem.getType() == ArmorItem.Type.SELF_BACKPACK) {
|
||||
final int particleCount = node.node(PARTICLE_COUNT).getInt(0);
|
||||
final int particleCount = node.node(PARTICLE_COUNT).getInt(5);
|
||||
this.backpackParticleCounts.put(armorItem.getId(), particleCount);
|
||||
}
|
||||
this.armorItemMap.put(armorItem.getId(), armorItem);
|
||||
|
||||
@@ -5,27 +5,10 @@ import com.github.retrooper.packetevents.protocol.entity.data.EntityData;
|
||||
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
|
||||
import com.github.retrooper.packetevents.protocol.entity.pose.EntityPose;
|
||||
import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
|
||||
import com.github.retrooper.packetevents.protocol.player.Equipment;
|
||||
import com.github.retrooper.packetevents.protocol.player.EquipmentSlot;
|
||||
import com.github.retrooper.packetevents.protocol.player.GameMode;
|
||||
import com.github.retrooper.packetevents.protocol.player.TextureProperty;
|
||||
import com.github.retrooper.packetevents.protocol.player.UserProfile;
|
||||
import com.github.retrooper.packetevents.protocol.player.*;
|
||||
import com.github.retrooper.packetevents.util.Vector3d;
|
||||
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerAttachEntity;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityEquipment;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityHeadLook;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityRelativeMove;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityRotation;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityTeleport;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityVelocity;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPlayerInfo;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSetPassengers;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnLivingEntity;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnPlayer;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.*;
|
||||
import io.github.fisher2911.hmccosmetics.HMCCosmetics;
|
||||
import io.github.retrooper.packetevents.util.SpigotConversionUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -35,7 +18,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -116,11 +98,11 @@ public class PacketManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendHeadLookPacket(final int entityId, Player... sendTo) {
|
||||
public static void sendHeadLookPacket(int entityId, float yaw, Player... sendTo) {
|
||||
for (final Player p : sendTo) {
|
||||
sendPacketAsync(p, new WrapperPlayServerEntityHeadLook(
|
||||
entityId,
|
||||
0
|
||||
yaw
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -157,16 +139,16 @@ public class PacketManager {
|
||||
final UUID uuid,
|
||||
final Player... sendTo) {
|
||||
for (final Player p : sendTo) {
|
||||
sendPacketAsync(p, new WrapperPlayServerSpawnLivingEntity(
|
||||
sendPacketAsync(p, new WrapperPlayServerSpawnEntity(
|
||||
entityId,
|
||||
uuid,
|
||||
Optional.of(uuid),
|
||||
entityType,
|
||||
new Vector3d(location.getX(), location.getY(), location.getZ()),
|
||||
location.getYaw(),
|
||||
location.getPitch(),
|
||||
0f,
|
||||
Vector3d.zero(),
|
||||
Collections.emptyList()
|
||||
0,
|
||||
Optional.of(Vector3d.zero())
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,11 @@ public class Backpack {
|
||||
|
||||
private final HMCCosmetics plugin;
|
||||
private final int armorStandID;
|
||||
private final int particleCount = HMCCosmetics.getPlugin(HMCCosmetics.class).getSettings().getCosmeticSettings().getParticleCount();
|
||||
private final List<Integer> particleIDS = new ArrayList<>();
|
||||
|
||||
public Backpack(HMCCosmetics plugin, int armorStandID) {
|
||||
this.plugin = plugin;
|
||||
this.armorStandID = armorStandID;
|
||||
for (int i = 0; i < particleCount; i++) {
|
||||
particleIDS.add(SpigotReflectionUtil.generateEntityId());
|
||||
}
|
||||
}
|
||||
|
||||
public void spawn(BaseUser<?> owner, Player other, Location location, Settings settings) {
|
||||
@@ -38,6 +34,7 @@ public class Backpack {
|
||||
this.spawnForOther(owner, other, location);
|
||||
return;
|
||||
}
|
||||
this.updateIds(owner);
|
||||
this.spawnForSelf(other, location);
|
||||
}
|
||||
|
||||
@@ -125,7 +122,7 @@ public class Backpack {
|
||||
PacketManager.sendArmorStandMetaContainer(this.armorStandID, other);
|
||||
PacketManager.sendRotationPacket(this.armorStandID, location, false, other);
|
||||
PacketManager.sendLookPacket(this.armorStandID, location, other);
|
||||
if (!isSelf) {
|
||||
if (!isSelf || !firstPersonMode || this.particleIDS.size() == 0) {;
|
||||
PacketManager.sendRidingPacket(owner.getEntityId(), this.armorStandID, other);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ cosmetic-settings:
|
||||
require-empty-chest-plate: false
|
||||
require-empty-pants: false
|
||||
require-empty-boots: false
|
||||
# Disable if you don't want to use the first person backpack system
|
||||
# See the wiki for more information
|
||||
first-person-backpack-mode: true
|
||||
|
||||
# The pitch the player must look down for the backpack to be removed
|
||||
# Set to -1 for no removal
|
||||
|
||||
28
common/src/main/resources/items.yml
Normal file
28
common/src/main/resources/items.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
1:
|
||||
material: PAPER
|
||||
name: "<blue>Backpack"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 8
|
||||
type: SELF_BACKPACK
|
||||
permission: ""
|
||||
id: backpack_self
|
||||
2:
|
||||
material: PAPER
|
||||
name: "<blue>Future Wings"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 10
|
||||
type: SELF_BACKPACK
|
||||
permission: ""
|
||||
id: future_wings_self
|
||||
@@ -11,7 +11,7 @@ items:
|
||||
locked-lore: # Lore displayed when the player does not have the correct permission.
|
||||
- "<red>You do not own this item!"
|
||||
applied-lore: # Lore displayed when the player has the cosmetic in their inventory.
|
||||
- "<gray>My awesome <rainbow>Colorful Hat</rainbow>!"
|
||||
- "<gray>My awesome <rainbow>Colorful Hat</rainbow>!"
|
||||
amount: 1
|
||||
model-data: 2 # CustomModelData Number
|
||||
type: HAT
|
||||
@@ -36,10 +36,32 @@ items:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 4
|
||||
action:
|
||||
equip:
|
||||
any:
|
||||
set-cosmetics: backpack_self
|
||||
type: BACKPACK
|
||||
permission: ""
|
||||
id: backpack
|
||||
3:
|
||||
material: PAPER
|
||||
name: "<#d24c9f>Future Wings"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 9
|
||||
action:
|
||||
equip:
|
||||
any:
|
||||
set-cosmetics: future_wings_self
|
||||
type: BACKPACK
|
||||
permission: ""
|
||||
id: future_wings
|
||||
4:
|
||||
material: PAPER
|
||||
name: "<blue>Lantern Cosmetic"
|
||||
lore:
|
||||
@@ -53,7 +75,7 @@ items:
|
||||
type: OFF_HAND
|
||||
permission: ""
|
||||
id: lantern_cosmetic
|
||||
4:
|
||||
5:
|
||||
material: PAPER
|
||||
name: "<blue>Baseball Hat"
|
||||
lore:
|
||||
@@ -67,7 +89,7 @@ items:
|
||||
type: HAT
|
||||
permission: ""
|
||||
id: baseball_hat
|
||||
5:
|
||||
6:
|
||||
material: DIAMOND_CHESTPLATE
|
||||
name: "<blue>Cosmetic Chestplate"
|
||||
lore:
|
||||
@@ -80,7 +102,7 @@ items:
|
||||
type: CHEST_PLATE
|
||||
permission: ""
|
||||
id: chestplate
|
||||
6:
|
||||
7:
|
||||
material: DIAMOND_LEGGINGS
|
||||
name: "<blue>Cosmetic Leggings"
|
||||
lore:
|
||||
@@ -93,7 +115,7 @@ items:
|
||||
type: PANTS
|
||||
permission: ""
|
||||
id: pants
|
||||
7:
|
||||
10:
|
||||
material: DIAMOND_BOOTS
|
||||
name: "<blue>Cosmetic Boots"
|
||||
lore:
|
||||
@@ -106,7 +128,7 @@ items:
|
||||
type: BOOTS
|
||||
permission: ""
|
||||
id: boots
|
||||
10:
|
||||
11:
|
||||
material: PAPER
|
||||
name: "<blue>Balloon"
|
||||
lore:
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
title: "<white>" # GUI Title
|
||||
rows: 5 # Rows in the GUI
|
||||
items:
|
||||
1: # GUI Slot number
|
||||
material: LEATHER_HORSE_ARMOR # Also supports Oraxen items! Format: "oraxen:item_name"
|
||||
name: "<rainbow>Colorful Hat</rainbow>"
|
||||
lore: # Lore displayed when the player owns the item
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore: # Lore displayed when the player does not have the correct permission.
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 2 # CustomModelData Number
|
||||
type: HAT
|
||||
dyeable: true # Enables dyeable item feature
|
||||
color: # Sets default color for item. Uses RGB format.
|
||||
red: 5
|
||||
green: 230
|
||||
blue: 100
|
||||
action: # See how the action system works on the wiki
|
||||
any:
|
||||
open-menu: dye-menu
|
||||
permission: "cosmetics.colorful_hat" # Can be anything you want.
|
||||
id: colorful_hat # Internal identifier. Can be anything you want.
|
||||
2:
|
||||
material: PAPER
|
||||
name: "<blue>Backpack"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 4
|
||||
type: BACKPACK
|
||||
permission: ""
|
||||
id: backpack
|
||||
action:
|
||||
# when the action should be run
|
||||
# equip = when a cosmetic is equipped
|
||||
# remove = when a cosmetic is removed
|
||||
# any all = default, does not need to be specified
|
||||
equip:
|
||||
# click type
|
||||
any:
|
||||
send-message: "on equip"
|
||||
remove:
|
||||
any:
|
||||
send-message: "on-remove"
|
||||
any:
|
||||
# send a message
|
||||
send-message: "Test first message"
|
||||
# send a command, format is <sender:command>
|
||||
# senders can be player or console
|
||||
send-command: "player:give %player% diamond"
|
||||
# list of messages
|
||||
send-messages:
|
||||
- "Message 1"
|
||||
- "Message 2"
|
||||
# list of commands
|
||||
send-commands:
|
||||
- "player:help"
|
||||
- "console:give %player% gold_ingot"
|
||||
# set items in the specified slots in the inventory
|
||||
# works with all actions
|
||||
# sets items in the next inventory if open-menu is specified
|
||||
set-items:
|
||||
12:
|
||||
material: PAPER
|
||||
name: "<red>Backpack"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 4
|
||||
type: BACKPACK
|
||||
permission: ""
|
||||
id: backpack
|
||||
action:
|
||||
any:
|
||||
send-message: "It worked?"
|
||||
set-items:
|
||||
12:
|
||||
material: PAPER
|
||||
name: "<rainbow>Backpack"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 4
|
||||
type: BACKPACK
|
||||
permission: ""
|
||||
id: backpack
|
||||
|
||||
3:
|
||||
material: PAPER
|
||||
name: "<blue>Lantern Cosmetic"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 5
|
||||
type: OFF_HAND
|
||||
permission: ""
|
||||
id: lantern_cosmetic
|
||||
4:
|
||||
material: PAPER
|
||||
name: "<blue>Baseball Hat"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
model-data: 6
|
||||
type: HAT
|
||||
permission: ""
|
||||
id: baseball_hat
|
||||
5:
|
||||
material: DIAMOND_CHESTPLATE
|
||||
name: "<blue>Cosmetic Chestplate"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
type: CHEST_PLATE
|
||||
permission: ""
|
||||
id: chestplate
|
||||
6:
|
||||
material: DIAMOND_LEGGINGS
|
||||
name: "<blue>Cosmetic Leggings"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
type: PANTS
|
||||
permission: ""
|
||||
id: pants
|
||||
7:
|
||||
material: DIAMOND_BOOTS
|
||||
name: "<blue>Cosmetic Boots"
|
||||
lore:
|
||||
- ""
|
||||
- "<gray>Enabled: <#6D9DC5>%enabled%"
|
||||
- "<gray>Allowed: <#6D9DC5>%allowed%"
|
||||
locked-lore:
|
||||
- "<red>You do not own this item!"
|
||||
amount: 1
|
||||
type: BOOTS
|
||||
permission: ""
|
||||
id: boots
|
||||
37:
|
||||
material: PAPER
|
||||
name: "<#40B7D6>Previous Page"
|
||||
amount: 1
|
||||
model-data: 1
|
||||
action:
|
||||
any:
|
||||
open-menu: menu-2
|
||||
40:
|
||||
material: PAPER
|
||||
name: "<rainbow>Customization Menu</rainbow>"
|
||||
amount: 1
|
||||
model-data: 3
|
||||
action:
|
||||
any:
|
||||
open-menu: dye-menu
|
||||
43:
|
||||
material: PAPER
|
||||
name: "<#40B7D6>Next Page"
|
||||
amount: 1
|
||||
model-data: 2
|
||||
action:
|
||||
any:
|
||||
open-menu: menu-2
|
||||
2
gradle.properties
Normal file
2
gradle.properties
Normal file
@@ -0,0 +1,2 @@
|
||||
copyJar=true
|
||||
hibiscusmc_plugin_path=""
|
||||
Reference in New Issue
Block a user