Skip to content

Commit

Permalink
Fixed resetting scale to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Oct 17, 2024
1 parent ad959b5 commit 59aecc0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,13 @@ public void update(Player player) {

}

if (data.getScale() != 1) {
Holder.Reference<Attribute> scaleAttribute = BuiltInRegistries.ATTRIBUTE.getHolder(new ResourceLocation("generic.scale")).get();
AttributeInstance attributeInstance = new AttributeInstance(scaleAttribute, (a) -> {
});
attributeInstance.setBaseValue(data.getScale());

ClientboundUpdateAttributesPacket updateAttributesPacket = new ClientboundUpdateAttributesPacket(npc.getId(), List.of(attributeInstance));
serverPlayer.connection.send(updateAttributesPacket);
}
Holder.Reference<Attribute> scaleAttribute = BuiltInRegistries.ATTRIBUTE.getHolder(new ResourceLocation("generic.scale")).get();
AttributeInstance attributeInstance = new AttributeInstance(scaleAttribute, (a) -> {
});
attributeInstance.setBaseValue(data.getScale());

ClientboundUpdateAttributesPacket updateAttributesPacket = new ClientboundUpdateAttributesPacket(npc.getId(), List.of(attributeInstance));
serverPlayer.connection.send(updateAttributesPacket);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,13 @@ public void update(Player player) {

}

if (data.getScale() != 1) {
Holder.Reference<Attribute> scaleAttribute = BuiltInRegistries.ATTRIBUTE.getHolder(ResourceLocation.parse("generic.scale")).get();
AttributeInstance attributeInstance = new AttributeInstance(scaleAttribute, (a) -> {
});
attributeInstance.setBaseValue(data.getScale());

ClientboundUpdateAttributesPacket updateAttributesPacket = new ClientboundUpdateAttributesPacket(npc.getId(), List.of(attributeInstance));
serverPlayer.connection.send(updateAttributesPacket);
}
Holder.Reference<Attribute> scaleAttribute = BuiltInRegistries.ATTRIBUTE.getHolder(ResourceLocation.parse("generic.scale")).get();
AttributeInstance attributeInstance = new AttributeInstance(scaleAttribute, (a) -> {
});
attributeInstance.setBaseValue(data.getScale());

ClientboundUpdateAttributesPacket updateAttributesPacket = new ClientboundUpdateAttributesPacket(npc.getId(), List.of(attributeInstance));
serverPlayer.connection.send(updateAttributesPacket);
}

@Override
Expand Down

0 comments on commit 59aecc0

Please sign in to comment.