use of org.spongepowered.common.accessor.world.entity.animal.WolfAccessor in project SpongeCommon by SpongePowered.
the class WolfData method register.
// @formatter:off
public static void register(final DataProviderRegistrator registrator) {
registrator.asMutable(Wolf.class).create(Keys.DYE_COLOR).get(h -> (DyeColor) (Object) h.getCollarColor()).set((h, v) -> h.setCollarColor((net.minecraft.world.item.DyeColor) (Object) v)).create(Keys.IS_BEGGING_FOR_FOOD).get(Wolf::isInterested).set(Wolf::setIsInterested).create(Keys.IS_WET).get(h -> ((WolfAccessor) h).accessor$isWet() || ((WolfAccessor) h).accessor$isShaking()).set((h, v) -> {
final WolfAccessor accessor = (WolfAccessor) h;
accessor.accessor$isWet(v);
accessor.accessor$isShaking(v);
accessor.accessor$shakeAnim(0f);
accessor.accessor$shakeAnimO(0f);
});
}
Aggregations