9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-06 15:51:50 +00:00

Compare commits

...

15 Commits

Author SHA1 Message Date
lucian929
70c2b79b6c Bump version number 2022-07-25 18:54:27 -04:00
Boy0000
39d485ddfe remove broadcast (#29) 2022-07-26 00:53:01 +02:00
lucian929
548a6bf4ec Merge pull request #28 from HibiscusMC/1.19_fix
1.19 fix
2022-07-25 18:50:24 -04:00
Boy
fb15919f52 update non-existing packet 2022-07-26 00:45:26 +02:00
lucian929
9a5923bb7d Merge remote-tracking branch 'origin/master' 2022-07-20 18:33:40 -04:00
lucian929
02239396f0 Changes to build.gradle.kts for MEG (temporary fix) 2022-07-20 18:33:20 -04:00
lucian929
942d48adf8 Merge pull request #26 from HibiscusMC/copyjar_task
add copyjar task
2022-07-17 18:06:01 -04:00
Boy
99ae2b765a add copyjar task 2022-07-18 00:04:13 +02:00
lucian929
6b59ba88a5 Bump version number 2022-07-11 13:15:12 -04:00
Fisher2911
4d7dff885a Merge remote-tracking branch 'origin/master' 2022-07-11 13:14:07 -04:00
Fisher2911
f4bc6f1bc3 Fixed particle amounts not working 2022-07-11 13:13:54 -04:00
lucian929
938dfe677d Fix mistake in config 2022-07-08 20:48:08 -04:00
Fisher2911
1c30924410 Merge remote-tracking branch 'origin/master' 2022-07-08 20:26:38 -04:00
lucian929
bd731c8b6b bump version number (1.11.0)! 2022-07-08 20:24:24 -04:00
lucian929
41f4f830d1 Update default configs 2022-07-08 20:22:50 -04:00
9 changed files with 101 additions and 234 deletions

View File

@@ -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")
}
}
}

View File

@@ -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);

View File

@@ -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())
));
}
}

View File

@@ -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;
}

View File

@@ -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

View 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

View File

@@ -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:

View File

@@ -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
View File

@@ -0,0 +1,2 @@
copyJar=true
hibiscusmc_plugin_path=""