mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2025-03-02 04:01:26 +01:00
Maybe this too
This commit is contained in:
parent
3ea2d7a042
commit
cd44863106
@ -85,10 +85,9 @@ public class PacketsHandler {
|
||||
|
||||
if (handler != null) {
|
||||
handler.handle(disguise, packets, observer, entity);
|
||||
return packets;
|
||||
}
|
||||
|
||||
} else {
|
||||
packets.setUnhandled(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -317,7 +317,14 @@ public class PacketHandlerSpawn implements IPacketHandler {
|
||||
if (NmsVersion.v1_21_R1.isSupported()) {
|
||||
Double scale = ((LivingWatcher) disguise.getWatcher()).getScale();
|
||||
|
||||
if (scale != null) {
|
||||
if (observer == disguisedEntity && DisguiseConfig.isTallSelfDisguisesScaling()) {
|
||||
if (scale == null) {
|
||||
scale = DisguiseUtilities.getActualEntityScale(observer);
|
||||
}
|
||||
|
||||
attributes.add(new WrapperPlayServerUpdateAttributes.Property(Attributes.GENERIC_SCALE,
|
||||
Math.min(disguise.getSelfDisguiseTallScaleMax(), scale), new ArrayList<>()));
|
||||
} else if (scale != null) {
|
||||
attributes.add(new WrapperPlayServerUpdateAttributes.Property(Attributes.GENERIC_SCALE, scale, new ArrayList<>()));
|
||||
}
|
||||
}
|
||||
@ -371,8 +378,10 @@ public class PacketHandlerSpawn implements IPacketHandler {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Workaround for this pending fix https://github.com/retrooper/packetevents/issues/869
|
||||
WrapperPlayServerEntityEquipment packet = new WrapperPlayServerEntityEquipment(disguisedEntity.getEntityId(),
|
||||
Collections.singletonList(new Equipment(slot, SpigotConversionUtil.fromBukkitItemStack(itemToSend))));
|
||||
Collections.singletonList(
|
||||
new Equipment(slot, DisguiseUtilities.stripEnchants(SpigotConversionUtil.fromBukkitItemStack(itemToSend)))));
|
||||
|
||||
packets.addDelayedPacket(packet);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user