Extended names false by default, don't give json on /ld automatically
This commit is contained in:
parent
901c6ef06f
commit
e55f88fc73
@ -397,7 +397,8 @@ public class DisguiseConfig {
|
|||||||
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
|
setEntityStatusPacketsEnabled(config.getBoolean("PacketsEnabled.EntityStatus"));
|
||||||
setEquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Equipment"));
|
setEquipmentPacketsEnabled(config.getBoolean("PacketsEnabled.Equipment"));
|
||||||
setExplicitDisguisePermissions(config.getBoolean("Permissions.ExplicitDisguises"));
|
setExplicitDisguisePermissions(config.getBoolean("Permissions.ExplicitDisguises"));
|
||||||
setExtendedDisguiseNames(config.getBoolean("ExtendedNames"));
|
// The default value shall be false if you don't update config
|
||||||
|
setExtendedDisguiseNames(config.contains("ScoreboardNames") && config.getBoolean("ExtendedNames"));
|
||||||
setHideArmorFromSelf(config.getBoolean("RemoveArmor"));
|
setHideArmorFromSelf(config.getBoolean("RemoveArmor"));
|
||||||
setHideDisguisedPlayers(config.getBoolean("HideDisguisedPlayersFromTab"));
|
setHideDisguisedPlayers(config.getBoolean("HideDisguisedPlayersFromTab"));
|
||||||
setHideHeldItemFromSelf(config.getBoolean("RemoveHeldItem"));
|
setHideHeldItemFromSelf(config.getBoolean("RemoveHeldItem"));
|
||||||
|
@ -50,47 +50,48 @@ public class PacketHandlerAttributes implements IPacketHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!disguise.isMiscDisguise()) {
|
if (disguise.isMiscDisguise()) {
|
||||||
packets.clear();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<WrappedAttribute> attributes = new ArrayList<>();
|
packets.clear();
|
||||||
PacketContainer updateAttributes = new PacketContainer(PacketType.Play.Server.UPDATE_ATTRIBUTES);
|
|
||||||
|
|
||||||
for (WrappedAttribute attribute : sentPacket.getAttributeCollectionModifier().read(0)) {
|
List<WrappedAttribute> attributes = new ArrayList<>();
|
||||||
if (attribute.getAttributeKey().equals("generic.maxHealth")) {
|
PacketContainer updateAttributes = new PacketContainer(PacketType.Play.Server.UPDATE_ATTRIBUTES);
|
||||||
WrappedAttribute.Builder builder;
|
|
||||||
|
|
||||||
if (((LivingWatcher) disguise.getWatcher()).isMaxHealthSet()) {
|
for (WrappedAttribute attribute : sentPacket.getAttributeCollectionModifier().read(0)) {
|
||||||
builder = WrappedAttribute.newBuilder();
|
if (attribute.getAttributeKey().equals("generic.maxHealth")) {
|
||||||
builder.attributeKey("generic.maxHealth");
|
WrappedAttribute.Builder builder;
|
||||||
builder.baseValue(((LivingWatcher) disguise.getWatcher()).getMaxHealth());
|
|
||||||
} else if (DisguiseConfig.isMaxHealthDeterminedByDisguisedEntity()) {
|
|
||||||
builder = WrappedAttribute.newBuilder(attribute);
|
|
||||||
} else {
|
|
||||||
builder = WrappedAttribute.newBuilder();
|
|
||||||
builder.attributeKey("generic.maxHealth");
|
|
||||||
builder.baseValue(
|
|
||||||
DisguiseValues.getDisguiseValues(disguise.getType()).getMaxHealth());
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.packet(updateAttributes);
|
if (((LivingWatcher) disguise.getWatcher()).isMaxHealthSet()) {
|
||||||
|
builder = WrappedAttribute.newBuilder();
|
||||||
attributes.add(builder.build());
|
builder.attributeKey("generic.maxHealth");
|
||||||
} else if (attribute.getAttributeKey().equals("generic.movementSpeed") &&
|
builder.baseValue(((LivingWatcher) disguise.getWatcher()).getMaxHealth());
|
||||||
disguise.getWatcher() instanceof AbstractHorseWatcher) {
|
} else if (DisguiseConfig.isMaxHealthDeterminedByDisguisedEntity()) {
|
||||||
WrappedAttribute.Builder builder = WrappedAttribute.newBuilder(attribute);
|
builder = WrappedAttribute.newBuilder(attribute);
|
||||||
builder.packet(updateAttributes);
|
} else {
|
||||||
|
builder = WrappedAttribute.newBuilder();
|
||||||
attributes.add(builder.build());
|
builder.attributeKey("generic.maxHealth");
|
||||||
|
builder.baseValue(DisguiseValues.getDisguiseValues(disguise.getType()).getMaxHealth());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!attributes.isEmpty()) {
|
builder.packet(updateAttributes);
|
||||||
packets.addPacket(updateAttributes);
|
|
||||||
|
|
||||||
updateAttributes.getIntegers().write(0, entity.getEntityId());
|
attributes.add(builder.build());
|
||||||
updateAttributes.getAttributeCollectionModifier().write(0, attributes);
|
} else if (attribute.getAttributeKey().equals("generic.movementSpeed") &&
|
||||||
|
disguise.getWatcher() instanceof AbstractHorseWatcher) {
|
||||||
|
WrappedAttribute.Builder builder = WrappedAttribute.newBuilder(attribute);
|
||||||
|
builder.packet(updateAttributes);
|
||||||
|
|
||||||
|
attributes.add(builder.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!attributes.isEmpty()) {
|
||||||
|
packets.addPacket(updateAttributes);
|
||||||
|
|
||||||
|
updateAttributes.getIntegers().write(0, entity.getEntityId());
|
||||||
|
updateAttributes.getAttributeCollectionModifier().write(0, attributes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ SaveDisguises:
|
|||||||
Entities: false
|
Entities: false
|
||||||
|
|
||||||
# Do names go beyond the 16 char limit for player disguises?
|
# Do names go beyond the 16 char limit for player disguises?
|
||||||
ExtendedNames: true
|
ExtendedNames: false
|
||||||
# Do names resolve into scoreboard teams so changing the player name is flawless?
|
# Do names resolve into scoreboard teams so changing the player name is flawless?
|
||||||
# This will only work properly for names 28 chars or less in length.
|
# This will only work properly for names 28 chars or less in length.
|
||||||
# Notch [DragonSlayer lvl: 28]
|
# Notch [DragonSlayer lvl: 28]
|
||||||
|
@ -106,7 +106,6 @@ permissions:
|
|||||||
description: Allows player to get meta info
|
description: Allows player to get meta info
|
||||||
libsdisguises.json:
|
libsdisguises.json:
|
||||||
description: Allows player to parse held item to json
|
description: Allows player to parse held item to json
|
||||||
default: true
|
|
||||||
libsdisguises.scoreboardtest:
|
libsdisguises.scoreboardtest:
|
||||||
description: Test if the scoreboard is valid, this is a simple test.
|
description: Test if the scoreboard is valid, this is a simple test.
|
||||||
libsdisguises.config:
|
libsdisguises.config:
|
||||||
|
Loading…
Reference in New Issue
Block a user